package dd.model;

import client.ServerAccess;
import dd.view.SignInScreen;
import dd.model.Event;

public class serverModel {
	/**
	 * fake sever database
	 * 
	 */
	Event event;
	SignInScreen sins;
	String userid[] = new String[10];
	int numofuserin = 0;
	
	static serverModel instance = null;
	/** Connection to server. */
	ServerAccess access;
	
	serverModel () {
		event =  new Event();
	}
	
	public static serverModel getInstance() {
		if (instance == null) {
			instance = new serverModel();
		}
		
		return instance;
	}
	
	public void setEvent (Event e) {
		this.event = e;
	}

	public Event getEvent() {
		return event;
	}
	/** Return the server access object. */
	public ServerAccess getServerAccess() {
		return access;
	}
	
	/** Application needs to know the access object for contacting server. */
	public void setServerAccess(ServerAccess sa) {
		this.access = sa;
	}
	public void setSignInScreen(SignInScreen sis){
		this.sins = sis;
	}
	public SignInScreen getSignInScreen(){
		return sins;
	}
	public void setuserid(int i,String id){
		userid[i] = id;
	}
	public String getuserid(int i){
		return userid[i];
	}
	public void setnumofuserin(int i){
		numofuserin = i;
	}
	public int getnumofuserin(){
		return numofuserin;
	}
}


